package com.example.esquel_carpool.utils;

import android.view.View;
import android.widget.ImageView;
import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.example.esquel_carpool.R;
import com.example.esquel_carpool.entity.home.ImagesBean;
import com.example.esquel_carpool.glideModule.GlideApp;

public class UrlImageHolderView extends Holder<ImagesBean> {

    private ImageView imageView;

    public UrlImageHolderView(View itemView) {
        super(itemView);
    }

    @Override
    protected void initView(View itemView) {
        imageView =itemView.findViewById(R.id.ivPost);
    }

    @Override
    public void updateUI(ImagesBean data) {
        GlideApp.with(imageView.getContext())
                .load(data.getPath())
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .error(R.drawable.ic_default_image)
               .fitCenter()
                .into(imageView);
    }
}
